<template>
  <div class="page-department">
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>生成发文资料
          </p>
        </div>
        <div class="topright">
          <el-button type="info" @click="$router.go(-1)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe606;</span>返回
          </el-button>
        </div>
      </div>
    </div>
    <div class="component-searchHeader">
      <div class="search-header">
        <div class="left-title">
          <p class="left-text"></p>
          <div class="right">
             <button @click="outPutPostData" style="width:110px;">导出文件</button>
          </div>
        </div>
      </div>
    </div>
    <div class="component-box">
      <!--<span class="iconfont">&#xe796;</span>-->
      <dl>
        <dt @click="$router.push({name:'postTableOne',query:{batchId:batchId}})">
          <span class="iconfont">&#xe796;</span>
        </dt>
        <dd>附件1 交维报告总汇</dd>
      </dl>
      <dl>
        <dt @click="$router.push({name:'postTableTwo',query:{batchId:batchId}})">
          <span class="iconfont">&#xe796;</span>
        </dt>
        <dd>附件2 - 客户点信息表</dd>
      </dl>
      <dl>
        <dt @click="$router.push({name:'postTableThree',query:{batchId:batchId}})">
          <span class="iconfont">&#xe796;</span>
        </dt>
        <dd>附件3 - 跳纤站点交维表</dd>
      </dl>
      <dl>
        <!--@click="$router.push({name:'postTableFour',query:{batchId:batchId}})"-->
        <dt>
          <span class="iconfont">&#xe653;</span>
        </dt>
        <dd>结算表</dd>
      </dl>
      <dl>
        <dt @click="$router.push({name:'postTableFive',query:{batchId:batchId}})">
          <span class="iconfont">&#xe796;</span>
        </dt>
        <dd>附件5 - 材料台账</dd>
      </dl>
    </div>
  </div>
</template>

<script>
export default {
  name: "productData",
  data() {
    return {
      batchId: "",
      baseUrl:img_url,
    };
  },
  created() {
    this.batchId = this.$route.query.batchId;
  },
  mounted() {},
  methods: {
    // 导出发文资料
    outPutPostData(){
      let that = this,
          suCb = res => {
            console.log("结果：", res);
            let a = document.createElement("a");
            a.href = baseUrl + res.data.data.url;
            a.download = res.data.data.fileName;
            a.target = '_blank'
            a.click();
            that.$msg("导出成功");
          },
          erCb = res => {
            console.log(res);
          },
          req = {
            url: "/api/web/proBatchDoc/downloadDispatchAttchment",
            methods: "post",
            data: { batchId: that.batchId },
            success: suCb,
            error: erCb
          };
        that.$https(req);
    }
  }
};
</script>

<style scoped>
.component-mainHeader .top .topright {
  font-size: 24px;
}

.component-searchHeader .search-header {
  width: 1100px;
  box-sizing: border-box;
  border: 1px solid rgba(228, 228, 228, 1);
  background-color: rgba(255, 255, 255, 1);
  margin: 20px auto 0;
}

.component-searchHeader .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
}

.component-searchHeader .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  font-family: "微软雅黑";
  font-weight: 400;
  font-size: 12px;
  line-height: 45px;
  text-align: left;
  margin: 0 0 0 30px;
}

.component-searchHeader .right {
  width: 120px;
  display: flex;
  justify-content: flex-end;
  margin-right: 30px;
}

.component-searchHeader .right button {
  width: 80px;
  padding: 0 15px;
  height: 30px;
  margin: 6px 5px;
  line-height: 30px;
  font-size: 12px;
  color: #666;
  background-color: #fff;
  border: 1px solid #ccc;
}

.component-searchHeader .right button:hover {
  background-color: #f3f3f3;
  cursor: pointer;
}

.component-box {
  display: flex;
  flex-wrap: wrap;
  width: 1100px;
  box-sizing: border-box;
  background-color: #fff;
  border: 1px solid #e4e4e4;
  border-top: none;
  margin: 0 auto;
  padding: 30px 50px;
}
.component-box dl {
  margin-right: 20px;
  margin-bottom: 30px;
  width: 234px;
}
.component-box dl:nth-of-type(4n) {
  margin-right: 0;
}
.component-box dl dt {
  width: 112px;
  height: 108px;
  background-color: rgba(242, 242, 242, 1);
  border-radius: 8px;
  margin: 10px auto;
  box-sizing: border-box;
  cursor: pointer;
}
.component-box dl dd {
  color: #666;
  font-size: 14px;
  text-align: center;
}
.component-box dl dt span {
  display: block;
  font-size: 60px;
  color: #1abc9c;
  line-height: 108px;
}
</style>
